#usr/bin/python



from PyQt4.QtCore import *
from PyQt4.QtGui import *



class TableView(QDialog):
	"""
	Class for handling the view of the cluster with colors
	"""
		
	def __init__(self, model):
		"""
		Constructor
		"""
		
		QDialog.__init__(self)
		self.model = model
		self.list_choice = ["Peaks found", "Peaks with isotopic cluster", "Peaks with fragment/adduct cluster",\
							"Peaks with high correlation values inter_sample"]
		self.setupUi()
		
		
	def setupUi(self):
		"""
		Making the ui
		"""
		
		vb =QVBoxLayout()
		hb =QHBoxLayout()
		label = QLabel("Highlighting peaks :", self)
		hb.addWidget(label)
		self.combobox = QComboBox(self)
		for element in self.list_choice:
			self.combobox.addItem(element)
		hb.addWidget(self.combobox)
		self.pushButton = QPushButton("GO", self)
		hb.addWidget(self.pushButton)
		vb.addLayout(hb)
		
		#table view creation
		self.table_view = QTableView()
		self.table_view.setSortingEnabled(True)
		self.table_view.setModel(self.model)
		#delegate =CustomItemDelegate(self.table_view)
		vb.addWidget(self.table_view)
		
		self.pushButton_2 = QPushButton("Export to csv", self)
		
		vb.addWidget(self.pushButton_2)
		
		self.setLayout(vb)

